Optimal. Leaf size=141 \[ \frac {1}{2} \left (a^2 B+2 b^2 B+2 a b (A+2 C)\right ) x+\frac {b^2 C \tanh ^{-1}(\sin (c+d x))}{d}+\frac {\left (2 A b^2+6 a b B+a^2 (2 A+3 C)\right ) \sin (c+d x)}{3 d}+\frac {a (2 A b+3 a B) \cos (c+d x) \sin (c+d x)}{6 d}+\frac {A \cos ^2(c+d x) (a+b \sec (c+d x))^2 \sin (c+d x)}{3 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.26, antiderivative size = 141, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 6, integrand size = 41, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.146, Rules used = {4179, 4159,
4132, 8, 4130, 3855} \begin {gather*} \frac {\sin (c+d x) \left (a^2 (2 A+3 C)+6 a b B+2 A b^2\right )}{3 d}+\frac {1}{2} x \left (a^2 B+2 a b (A+2 C)+2 b^2 B\right )+\frac {a (3 a B+2 A b) \sin (c+d x) \cos (c+d x)}{6 d}+\frac {A \sin (c+d x) \cos ^2(c+d x) (a+b \sec (c+d x))^2}{3 d}+\frac {b^2 C \tanh ^{-1}(\sin (c+d x))}{d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 3855
Rule 4130
Rule 4132
Rule 4159
Rule 4179
Rubi steps
\begin {align*} \int \cos ^3(c+d x) (a+b \sec (c+d x))^2 \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx &=\frac {A \cos ^2(c+d x) (a+b \sec (c+d x))^2 \sin (c+d x)}{3 d}+\frac {1}{3} \int \cos ^2(c+d x) (a+b \sec (c+d x)) \left (2 A b+3 a B+(2 a A+3 b B+3 a C) \sec (c+d x)+3 b C \sec ^2(c+d x)\right ) \, dx\\ &=\frac {a (2 A b+3 a B) \cos (c+d x) \sin (c+d x)}{6 d}+\frac {A \cos ^2(c+d x) (a+b \sec (c+d x))^2 \sin (c+d x)}{3 d}-\frac {1}{6} \int \cos (c+d x) \left (-2 \left (2 A b^2+6 a b B+a^2 (2 A+3 C)\right )-3 \left (a^2 B+2 b^2 B+2 a b (A+2 C)\right ) \sec (c+d x)-6 b^2 C \sec ^2(c+d x)\right ) \, dx\\ &=\frac {a (2 A b+3 a B) \cos (c+d x) \sin (c+d x)}{6 d}+\frac {A \cos ^2(c+d x) (a+b \sec (c+d x))^2 \sin (c+d x)}{3 d}-\frac {1}{6} \int \cos (c+d x) \left (-2 \left (2 A b^2+6 a b B+a^2 (2 A+3 C)\right )-6 b^2 C \sec ^2(c+d x)\right ) \, dx-\frac {1}{2} \left (-a^2 B-2 b^2 B-2 a b (A+2 C)\right ) \int 1 \, dx\\ &=\frac {1}{2} \left (a^2 B+2 b^2 B+2 a b (A+2 C)\right ) x+\frac {\left (2 A b^2+6 a b B+a^2 (2 A+3 C)\right ) \sin (c+d x)}{3 d}+\frac {a (2 A b+3 a B) \cos (c+d x) \sin (c+d x)}{6 d}+\frac {A \cos ^2(c+d x) (a+b \sec (c+d x))^2 \sin (c+d x)}{3 d}+\left (b^2 C\right ) \int \sec (c+d x) \, dx\\ &=\frac {1}{2} \left (a^2 B+2 b^2 B+2 a b (A+2 C)\right ) x+\frac {b^2 C \tanh ^{-1}(\sin (c+d x))}{d}+\frac {\left (2 A b^2+6 a b B+a^2 (2 A+3 C)\right ) \sin (c+d x)}{3 d}+\frac {a (2 A b+3 a B) \cos (c+d x) \sin (c+d x)}{6 d}+\frac {A \cos ^2(c+d x) (a+b \sec (c+d x))^2 \sin (c+d x)}{3 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.53, size = 157, normalized size = 1.11 \begin {gather*} \frac {6 \left (a^2 B+2 b^2 B+2 a b (A+2 C)\right ) (c+d x)-12 b^2 C \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )+12 b^2 C \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )+3 \left (4 A b^2+8 a b B+a^2 (3 A+4 C)\right ) \sin (c+d x)+3 a (2 A b+a B) \sin (2 (c+d x))+a^2 A \sin (3 (c+d x))}{12 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.11, size = 154, normalized size = 1.09
method | result | size |
derivativedivides | \(\frac {A \,b^{2} \sin \left (d x +c \right )+b^{2} B \left (d x +c \right )+b^{2} C \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+2 a A b \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+2 a b B \sin \left (d x +c \right )+2 a b C \left (d x +c \right )+\frac {A \,a^{2} \left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{3}+a^{2} B \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+a^{2} C \sin \left (d x +c \right )}{d}\) | \(154\) |
default | \(\frac {A \,b^{2} \sin \left (d x +c \right )+b^{2} B \left (d x +c \right )+b^{2} C \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+2 a A b \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+2 a b B \sin \left (d x +c \right )+2 a b C \left (d x +c \right )+\frac {A \,a^{2} \left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{3}+a^{2} B \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+a^{2} C \sin \left (d x +c \right )}{d}\) | \(154\) |
risch | \(a A b x +\frac {a^{2} B x}{2}+x \,b^{2} B +2 a b x C -\frac {3 i A \,a^{2} {\mathrm e}^{i \left (d x +c \right )}}{8 d}-\frac {i {\mathrm e}^{i \left (d x +c \right )} A \,b^{2}}{2 d}+\frac {i {\mathrm e}^{-i \left (d x +c \right )} A \,b^{2}}{2 d}-\frac {i {\mathrm e}^{i \left (d x +c \right )} a^{2} C}{2 d}+\frac {i {\mathrm e}^{-i \left (d x +c \right )} a^{2} C}{2 d}+\frac {3 i A \,a^{2} {\mathrm e}^{-i \left (d x +c \right )}}{8 d}+\frac {i {\mathrm e}^{-i \left (d x +c \right )} a b B}{d}-\frac {i {\mathrm e}^{i \left (d x +c \right )} a b B}{d}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) b^{2} C}{d}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) b^{2} C}{d}+\frac {A \,a^{2} \sin \left (3 d x +3 c \right )}{12 d}+\frac {a A b \sin \left (2 d x +2 c \right )}{2 d}+\frac {a^{2} B \sin \left (2 d x +2 c \right )}{4 d}\) | \(272\) |
norman | \(\frac {\left (-a A b -\frac {1}{2} a^{2} B -b^{2} B -2 a b C \right ) x +\left (-3 a A b -\frac {3}{2} a^{2} B -3 b^{2} B -6 a b C \right ) x \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (a A b +\frac {1}{2} a^{2} B +b^{2} B +2 a b C \right ) x \left (\tan ^{12}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (3 a A b +\frac {3}{2} a^{2} B +3 b^{2} B +6 a b C \right ) x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\frac {\left (2 A \,a^{2}-2 a A b +2 A \,b^{2}-a^{2} B +4 a b B +2 a^{2} C \right ) \left (\tan ^{11}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}+\frac {2 \left (2 A \,a^{2}-2 a A b -2 A \,b^{2}-a^{2} B -4 a b B -2 a^{2} C \right ) \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {2 \left (2 A \,a^{2}+2 a A b -2 A \,b^{2}+a^{2} B -4 a b B -2 a^{2} C \right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {\left (2 A \,a^{2}+2 a A b +2 A \,b^{2}+a^{2} B +4 a b B +2 a^{2} C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}-\frac {\left (14 A \,a^{2}-18 a A b +6 A \,b^{2}-9 a^{2} B +12 a b B +6 a^{2} C \right ) \left (\tan ^{9}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 d}+\frac {\left (14 A \,a^{2}+18 a A b +6 A \,b^{2}+9 a^{2} B +12 a b B +6 a^{2} C \right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{3} \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{3}}+\frac {b^{2} C \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{d}-\frac {b^{2} C \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{d}\) | \(507\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.32, size = 157, normalized size = 1.11 \begin {gather*} -\frac {4 \, {\left (\sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )} A a^{2} - 3 \, {\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} B a^{2} - 6 \, {\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} A a b - 24 \, {\left (d x + c\right )} C a b - 12 \, {\left (d x + c\right )} B b^{2} - 6 \, C b^{2} {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 12 \, C a^{2} \sin \left (d x + c\right ) - 24 \, B a b \sin \left (d x + c\right ) - 12 \, A b^{2} \sin \left (d x + c\right )}{12 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 3.47, size = 127, normalized size = 0.90 \begin {gather*} \frac {3 \, C b^{2} \log \left (\sin \left (d x + c\right ) + 1\right ) - 3 \, C b^{2} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 3 \, {\left (B a^{2} + 2 \, {\left (A + 2 \, C\right )} a b + 2 \, B b^{2}\right )} d x + {\left (2 \, A a^{2} \cos \left (d x + c\right )^{2} + 2 \, {\left (2 \, A + 3 \, C\right )} a^{2} + 12 \, B a b + 6 \, A b^{2} + 3 \, {\left (B a^{2} + 2 \, A a b\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{6 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (a + b \sec {\left (c + d x \right )}\right )^{2} \left (A + B \sec {\left (c + d x \right )} + C \sec ^{2}{\left (c + d x \right )}\right ) \cos ^{3}{\left (c + d x \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 346 vs.
\(2 (133) = 266\).
time = 0.52, size = 346, normalized size = 2.45 \begin {gather*} \frac {6 \, C b^{2} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - 6 \, C b^{2} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) + 3 \, {\left (B a^{2} + 2 \, A a b + 4 \, C a b + 2 \, B b^{2}\right )} {\left (d x + c\right )} + \frac {2 \, {\left (6 \, A a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 3 \, B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 6 \, C a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 6 \, A a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 12 \, B a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 6 \, A b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 4 \, A a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 12 \, C a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 24 \, B a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 12 \, A b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 6 \, A a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 3 \, B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 6 \, C a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 6 \, A a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 12 \, B a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 6 \, A b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}^{3}}}{6 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 4.55, size = 263, normalized size = 1.87 \begin {gather*} \frac {3\,A\,a^2\,\sin \left (c+d\,x\right )}{4\,d}+\frac {A\,b^2\,\sin \left (c+d\,x\right )}{d}+\frac {C\,a^2\,\sin \left (c+d\,x\right )}{d}+\frac {B\,a^2\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {2\,B\,b^2\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {2\,C\,b^2\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {A\,a^2\,\sin \left (3\,c+3\,d\,x\right )}{12\,d}+\frac {B\,a^2\,\sin \left (2\,c+2\,d\,x\right )}{4\,d}+\frac {2\,B\,a\,b\,\sin \left (c+d\,x\right )}{d}+\frac {2\,A\,a\,b\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {4\,C\,a\,b\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {A\,a\,b\,\sin \left (2\,c+2\,d\,x\right )}{2\,d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________